<template>
    <div>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media">
                <router-link to="'/home/newsInfo/'+1" href="javascript:;">
                    <img class="mui-media-object mui-pull-left" src="">
                    <div class="mui-media-body">
                        <h1>幸福</h1>
                        <p class='mui-ellipsis'>
                            <span>发表时间 : 2012-12-12</span>
                            <span>点击次数</span>
                        </p>
                    </div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media">
                <router-link to="'/home/newsInfo/'+2" href="javascript:;">
                    <img class="mui-media-object mui-pull-left" src="">
                    <div class="mui-media-body">
                        <h1>幸福</h1>
                        <p class='mui-ellipsis'>
                            <span>发表时间 : 2012-12-12</span>
                            <span>点击次数</span>
                        </p>
                    </div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media">
                <router-link to="'/home/newsInfo/'+3" href="javascript:;">
                    <img class="mui-media-object mui-pull-left" src="">
                    <div class="mui-media-body">
                        <h1>幸福</h1>
                        <p class='mui-ellipsis'>
                            <span>发表时间 : 2012-12-12</span>
                            <span>点击次数</span>
                        </p>
                    </div>
                </router-link>
            </li>

        </ul>
    </div>
</template>

<script>
    export default {
        data(){
            return {
                newsList: []//用来保存数据
            }
        },
        created(){
          this.getNewsList()
        },
        methods: {
            getNewsList(){
                this.$http.get('api/getnewslist').then(result=>{
                    if (result.body.status === 0 ){
                        //成功,把数据保存到data 上
                        this.newsList = result.body.message
                    } else {
                        Toast('获取新闻列表失败')
                    }
                })
            }
        }
    }
</script>

<style lang="less" scoped>
    .mui-table-view {
        li {
            h1 {
                font-size: 14px;

            }
            .mui-ellipsis {
                font-size: 12px;
                color: #222;
                display: flex;
                justify-content: space-between;
            }
        }
    }
</style>